﻿#pragma once
#include <QDialog>
#include <QTableWidget>
#include <QLineEdit>
#include <QPushButton>
#include <QLabel>
#include <QComboBox>
#include "UndoRedo_seat.h"

class SeatAdminDialog : public QDialog
{
    Q_OBJECT
public:
    explicit SeatAdminDialog(QWidget* parent = nullptr);

private slots:
    void refreshSeatTable();
    void showInfo(const QString& msg);
    void onAddSeat();
    void onDeleteSeat();
    void onEditSeat();
    void onSearchSeat();
    void onSeatNoEditChanged(const QString& text); // 新增槽
    void updateRecordCount();

private:
    QTableWidget* table;
    QLineEdit* idEdit;
    QLineEdit* trainIdEdit;
    QLineEdit* seatNoEdit;
    QComboBox* seatTypeComboBox; // 下拉菜单
    QPushButton* addBtn;
    QPushButton* editBtn;
    QPushButton* deleteBtn;
	QPushButton* undoBtn;
	QPushButton* redoBtn;
    QLineEdit* searchEdit;
    QPushButton* searchBtn;
    QLabel* infoLabel;
    QLabel* recordCountLabel;
	UndoRedo_seat undoRedo; // 撤销重做管理器
};
